<?php

class Friends extends Controller {

	function Friends()
	{
		parent::Controller();	
        $this->load->model('friendsmodel');   
	}
	
	function index()
	{

        //load page header
        $this->load->model('pageheadersmodel'); 
        $data["header"] = $this->pageheadersmodel->get_header('friends');
            
        //items
        $data['list'] = $this->friendsmodel->get_list();

        
        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "Friends")); 
        $this->load->view('website/default/header');  
        $this->load->view('website/friends/friends', $data);   
        $this->load->view('website/default/footer');   
	}


    function view($id = NULL)
    {

        //item
        $data["item"] = $this->friendsmodel->get_item($id); 
        if (empty($data["item"])) show_404();                                              

        //list
        $data["list"] = $this->friendsmodel->get_list();

        $this->load->model('glossarymodel');

        $this->load->view('website/default/head', array("document_title" => DOCUMENT_TITLE . "Friends - " .$data["item"]["Title_Friends"]));   
        $this->load->view('website/default/header');  
        $this->load->view('website/friends/friends_detail', $data);   
        $this->load->view('website/default/footer');   

    }
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */